package zhuyun.code.launcheractivity.view.adapter

import android.view.View
import zhuyun.code.launcheractivity.R
import zhuyun.code.launcheractivity.model.data.RecProductTwoListBean
import zhuyun.code.launcheractivity.utils.GlideUtil

/**
 * @author: Administrator
 * @date: 2021/11/21
 */
class HomeTwoProductListAdapter(val data:MutableList<RecProductTwoListBean>):
    BaseQuickAdapter<RecProductTwoListBean,BaseViewHolder>(R.layout.item_product,data) {
    override fun convert(helper: BaseViewHolder, item: RecProductTwoListBean) {
        helper.setText(R.id.tvProductName,item.ProductName)
        helper.setText(R.id.tvProductPrice,item.ProductPrice)
        GlideUtil.displayAppointImage(item.MainPicUrl,helper.getView(R.id.image))
        helper.setVisibility(R.id.lineLeft,if(helper.adapterPosition == 0) View.VISIBLE else View.GONE)
        helper.setVisibility(R.id.lineRight,if(helper.adapterPosition == itemCount-1) View.VISIBLE else View.GONE)

    }
}